SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Emilio Augusto Veras Ivanovich
-- Create date: 1/19/2012
-- Description:	Filter Call by ID
-- =============================================
ALTER PROCEDURE [DBO].[PROCEDURE_CALLS_FILTERED_BY_ID]
	-- Parameters for the stored procedure
	@ID BIGINT = 0
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	SET NOCOUNT ON;
    -- Select Statement for procedure 
    SELECT
		CALLS.ID,
		CALLS.COMMENTS,
		CALLS.OPEN_BY_USER,
		CALLS.SAMPLE,
		CALLS.SHIPPING,
		CALLS.RESULT,
		CALLS.DOCTOR_ID,
		DOCTORS.DESCRIPTION,
		CALLS.CLOSE_BY_USER
	FROM
		CALLS
		INNER JOIN DOCTORS ON DOCTORS.ID = CALLS.DOCTOR_ID
	WHERE
		CALLS.ID = @ID;
END
GO